﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FJERP.Model;
using FJERP.DAL;
using System.Data.SqlClient;
using System.Data;

namespace FJERP.BLL
{
   public  class StockBLL
    {
        StockDAL dal = new StockDAL();

        /// <summary>
        /// 库存的分页显示
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public List<Stock> ShowStock(int PageIndex, int PageSize)
        {
            return dal.ShowStock(PageIndex, PageSize);
        }
        /// <summary>
        /// 获取总记录数
        /// </summary>
        /// <returns></returns>
        public int Count()
        {
            return dal.Count();
        }
        /// <summary>
        /// 获取单行数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable GetStockById(int id)
        {
            return dal.GetStockById(id);
        }
        public List<Blitem_Type> GetPandianType()
        {
            return dal.GetPandianType();
        }
       /// <summary>
       /// 添加
       /// </summary>
       /// <param name="b"></param>
       /// <returns></returns>
        public int AddPandian(Blitem b)
        {
            return dal.AddPandian(b);
        }
        /// <summary>
       /// 根据仓库名称查询
       /// </summary>
       /// <param name="PageIndex"></param>
       /// <param name="PageSize"></param>
       /// <param name="name"></param>
       /// <returns></returns>
        public List<Stock> Search(int PageIndex, int PageSize, string name,out int count)
        {
            return dal.Search(PageIndex, PageSize, name, out count);
        }
    }
}
